package com.geek.javase.ch02.test4;
/*
 *@author wangpeng
 *2025/10/10 13:27
 *@description 经理类
 */
public class Manager extends Employee {
    // 特有属性：所管部门
    private String department;

    // 无参构造方法
    public Manager() {
        super(); // 调用父类无参构造方法
    }

    // 有参构造方法
    public Manager(String name, String address, double baseSalary, String department) {
        super(name, address, baseSalary); // 调用父类有参构造方法
        this.department = department;
    }

    // getter和setter方法
    public String getDepartment() {
        return department;
    }

    public void setDepartment(String department) {
        this.department = department;
    }

    // 重写show方法
    @Override
    public void show() {
        super.show(); // 调用父类的show方法
        System.out.println("经理所管部门: " + this.department);
    }
}
